/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package com.xiashitech.agent.instrumentation.httpurlconnection.common;

import io.opentelemetry.javaagent.shaded.io.opentelemetry.context.propagation.TextMapGetter;
import java.net.HttpURLConnection;

public enum ConnectionHeaderGetter implements TextMapGetter<HttpURLConnection> {
  INSTANCE;

  @Override
  public Iterable<String> keys(HttpURLConnection carrier) {
    return carrier.getHeaderFields().keySet();
  }

  @Override
  public String get(HttpURLConnection carrier, String key) {
    return carrier.getHeaderField(key);
  }
}
